﻿using HuiZe.education.Resource.Controls;
using System;
using System.Windows;
using System.Windows.Media;

namespace HuiZe.education.View
{
    /// <summary>
    /// Win_CloudClass_ResourceViewer.xaml 的交互逻辑
    /// </summary>
    public partial class Win_CloudClass_ResourceViewer : HuiZeWindow
    {
        public Win_CloudClass_ResourceViewer(string _name, string _url)
        {
            InitializeComponent();
            _res_url = _url;
            PART_Title.Text = _name;
            this.WindowStyle = WindowStyle.None;
            this.Background = Brushes.Transparent;
            this.ResizeMode = ResizeMode.NoResize;
            this.WindowStartupLocation = WindowStartupLocation.CenterOwner;
            PART_WebBrowser.ScriptErrorsSuppressed = true;
            Loaded += Win_CloudClass_ResourceViewer_Loaded;
        }

        void Win_CloudClass_ResourceViewer_Loaded(object sender, RoutedEventArgs e)
        {
            PART_WebBrowser.Navigate(string.IsNullOrEmpty(_res_url) ? "about:blank" : _res_url);
        }

        void PART_Close_Click(object sender, RoutedEventArgs e)
        {
            Window.GetWindow(this).Close();
        }


        string _res_url;
    }
}
